/******************************************************************************
 * FILE NAME:
 *  syslog_api_platform.h
 *
 * DESCRIPTION:
 * This file contains the function declarations and MARCOS
 * of api-platform.
 *
 * DESIGN REFERENCE:
 *
 *
 * REVISION HISTORY   :
 * Date            Author               REASON
 * 06.08.2013      Thuan Nguyen         Creation
 *
 * Copyright 2005, NET
 * ***************************************************************************/


#ifndef SYSLOG_API_PLATFORM_H_
#define SYSLOG_API_PLATFORM_H_


#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<stdio.h>
#include<stdlib.h>

#include"common_def.h"
#include"logging.h"
#include"../../transport/h/trs_queue_def.h"


/*Allocation API*/
#define T_OS_BLOCK_ALLOC(caller_id,block_size) \
		syslog_alloc(caller_id,block_size)
#define T_OS_BLOCK_DEALLOC(caller_id,block_ptr) \
		syslog_dealloc(caller_id,block_ptr)

/*Communication API*/
#define T_OS_SEND_MSG_QUEUE(caller_id, dest_task, msg, msg_len) \
		api_send_msg_queue(caller_id, dest_task, msg, msg_len)

#define T_OS_RECEI_MSG_QUEUE(caller_id) \
		api_receive_msg_queue(caller_id)

#define T_OS_SEND_MSG(caller_id, socket_id, msg, msg_len,protocol) \
		api_send_msg_func(caller_id, socket_id, msg, msg_len , protocol)

#define T_OS_RECEI_MSG(caller_id,socket_id,msg,protocol) \
		api_receive_msg_func(caller_id,socket_id,msg,protocol)

U32 api_send_msg_func(U32 sender_id,U32 receiver_id,U8 socket_id,void *msg \
		,U32 msg_len,U8 protocol);
U32 api_receive_msg_func(U32 caller_id,U8 socket_id,void *msg,U8 protocol);


void api_send_msg_queue(U32 sender_id,U32 receiver_id,void *msg,U32 msg_len);
void* api_receive_msg_queue(U32 caller_id);


void* syslog_alloc(U32 caller_id,U32 block_size);
void syslog_dealloc(U32 caller_id,void *block_ptr);

#endif /* SYSLOG_API_PLATFORM_H_ */
